package com.autumn.platform.dao.schema.statement.extend;

import org.apache.ibatis.parsing.XNode;
import org.apache.ibatis.session.Configuration;

import com.autumn.platform.dao.DaoUtils;
import com.autumn.platform.dao.schema.parser.SchemaSqlMapperParserDelegate;
import com.autumn.platform.dao.schema.statement.StatementHandlerSupport;

public class DbStatementHandler extends StatementHandlerSupport {

    @Override
    public void handleStatementNode(Configuration configuration, SchemaSqlMapperParserDelegate delegate, XNode node) {
        if (DaoUtils.isMatchDatabase(configuration.getDatabaseId(), node.getStringAttribute("type"))) {
            delegate.doParseStatements(node.getNode());
        }
    }
}
